<ion-view view-title="牛股宝" >
    <ion-nav-buttons side="left" >
        <back-button></back-button>
        <a ng-href="#/tab/search" class="btnSearch"></a>
    </ion-nav-buttons>
    <ion-nav-buttons  side="right">
        <a ng-click="show()"  style="right:50px" class="button button-clear icon-right">排序</a>
    </ion-nav-buttons>
    <ion-content scroll-to-top="1" delegate-handle="scroller" ng-class="{'has-loading': isOffline}">

        <ion-refresher pulling-text={{PULLING_TEXT}} pulling-icon="" refreshing-text={{REFRESHING_TEXT}}
                       on-refresh="doRefresh()"></ion-refresher>

        <!-- promo -->
        <input type="hidden" ng-model="channel.adId" value="4616" keep-current-value/>

        <channel-img ng-click="showAds(true);"></channel-img>

        <div class="term" ng-show="vm.activeTab == 1">
            <div class="panel" ng-repeat="item in funds">
                <a href="#/tab/product-item-QDII/{{item.prod_code}}" >
                    <h2 class="item">{{item.prod_name}}</h2>
                    <div class="item">
                        <p ng-if="item.prod_status!=4">近一年涨幅<em ng-class="{inc_ : item.price_increase_year< 0}">{{item.price_increase_year | defNumber : 2}}<sub>%</sub></em></p>
                        <p ng-if="item.prod_status==4">认购截止日<em >{{item.ipo_end_date | defDateString}}</em></p>
                        <p>单位净值<em>{{item.prod_nav | defNumber : 4}}<sub>元</sub></em></p>
                        <p>起购金额<em ng-bind-html="item.prod_min_subscribe"></em></p>
                    </div>
                </a>
            </div>
        </div>


        <div class="term" ng-show="vm.activeTab == 2">
            <div class="panel" ng-repeat="item in funds | orderBy : ['prod_grade_level','price_increase_year']: true">
                <a href="#/tab/product-item-QDII/{{item.prod_code}}" >
                    <h2 class="item">{{item.prod_name}}</h2>
                    <div class="item">
                        <p ng-if="item.prod_status!=4">近一年涨幅<em ng-class="{inc_ : item.price_increase_year< 0}">{{item.price_increase_year | defNumber : 2}}<sub>%</sub></em></p>
                        <p ng-if="item.prod_status==4">认购截止日<em >{{item.ipo_end_date | defDateString}}</em></p>
                        <p>单位净值<em>{{item.prod_nav | defNumber : 4}}<sub>元</sub></em></p>
                        <p>基金评级<em class="grade g{{item.prod_grade_level}}"></em></p></div>
                </a>
            </div>
        </div>

        <div class="unlimited" ng-show="vm.activeTab == 3">
            <div class="niugu QDII-Top" ng-repeat="item in companys | orderBy : 'org_level' : true" ng-class="{on : item.isOpen}">
                <dl ng-click="item.isOpen = !item.isOpen">
                    <dt><img ng-src="{{item.org_pic_url}}"/></dt>
                    <dd><h2>{{item.org_name}}</h2>
                        <div class="increase"><em class="grade g{{item.org_level}}"></em>
                            <p>基金公司评级</p>
                        </div>
                    </dd>
                </dl>
                <div class="retract" ng-click="item.isOpen = !item.isOpen">收起</div>
                <div class="term" >
                    <div class="intro">{{item.org_description}}</div>
                    <div class="hd">相关基金</div>
                    <div class="panel" ng-repeat="fund in item.funds">
                        <a href="#/tab/product-item-QDII/{{fund.prod_code}}" >
                            <h2 class="item">{{fund.prod_name}}</h2>
                            <div class="item">
                                <p ng-if="item.prod_status!=4">近一年涨幅<em ng-class="{inc_ : fund.price_increase_year< 0}">{{fund.price_increase_year | defNumber : 2}}<sub>%</sub></em></p>
                                <p ng-if="item.prod_status==4">认购截止日<em >{{item.ipo_end_date | defDateString}}</em></p>
                                <p>单位净值<em>{{fund.prod_nav | defNumber : 4}}<sub>元</sub></em></p>
                                <p>起购金额<em ng-bind-html="fund.prod_min_subscribe"></em></p>
                            </div>
                        </a>
                    </div>
                </div>
            </div>

        </div>

    </ion-content>
    <scroll-to-top-button animate="true">
        <a class="backTop">↑</a>
    </scroll-to-top-button>
</ion-view>